#include<iostream>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
int n, m;
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n >> m;
		int l = 1, r = n;
		for (int i = 1; i <= n; i++) {
			if (i & 1) {
				cout << r << endl;
				r--;
			}
			else {
				cout << l << endl;
				l++;
			}
		}
	}
	return 0;
}